﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebLibs;

namespace TGVR.Manager.UserControls.Template
{
    public class TGVRUserControlBase : System.Web.UI.UserControl
    {
        #region data members
        protected MDF.DataHelper.BussinessObject.UsersBO.UserProfile User
        {
            get { return (HttpContext.Current.Session["user"] as MDF.DataHelper.BussinessObject.UsersBO.UserProfile); }
        }

        protected MessageBox.MessageBox MsgBox
        {
            get
            {
                return Page.Master.FindControl("MessageBox1") as MessageBox.MessageBox;
            }
        }

        private string ErrorPagePath = "/Error.aspx";
        #endregion

        #region methods
        protected void RedirectToErrorPage(string message = null)
        {
            HttpContext.Current.Session["error"] = message;
            HttpContext.Current.Response.Redirect(Globals.ApplicationVRoot() + ErrorPagePath, false);
        }
        #endregion
    }
}